package model;

public enum Action
{
	CHECK(0), CALL(1), RAISE(2), FOLD(3);
	
	private final int index;
	
	private Action(int index)
	{
		this.index = index;
	}
	
	public static Action valueOf(int index)
	{
		if (index >= 0 && index <= 2)
		{
			return Action.values()[index];
		}
		
		return null;
	}
	
	public int toInteger()
	{
		return index;
	}
	
	public String toString()
	{
		switch (this)
		{
			case CHECK:
				
				return "Check";
			
			case CALL:
				
				return "Call";
			
			case RAISE:
				
				return "Raise";
			
			case FOLD:
				
				return "Fold";
		}
		
		return null;
	}
}
